package org.eae.eldf.service.base.impl;

import org.eae.eldf.dao.base.IBaseLanguageDao;
import org.eae.eldf.dao.base.impl.BaseLanguageDaoImpl;
import org.eae.eldf.dto.base.BaseLanguageDto;
import org.eae.eldf.entity.base.BaseLanguage;
import org.eae.eldf.framework.pager.Pagination;
import org.eae.eldf.framework.persistence.Criteria;
import org.eae.eldf.framework.service.BaseServiceImpl;
import org.eae.eldf.service.base.BaseLanguageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class BaseLanguageServiceImpl extends BaseServiceImpl<BaseLanguage> implements BaseLanguageService{

	private IBaseLanguageDao baseLanguageDao ;
	
	@Autowired
	public void setBaseLanguageDao(BaseLanguageDaoImpl baseLanguageDao) {
		this.baseLanguageDao = baseLanguageDao;
		this.dao = baseLanguageDao;
	}
	
	/**
	 * 查询
	 */
	@Override
	public Pagination<BaseLanguageDto> pageLanguageList(Pagination<BaseLanguageDto> pager, String searchValue,
			String searchValueInfo) {
		// TODO Auto-generated method stub
		pager= baseLanguageDao.pageLaguageList(pager, searchValue, searchValueInfo);
		return pager;
		
	}

	/**
	 * 物理删除 
	 * @param base_language_id 
	 */
	@Override
	public void deleteByLaguageId(Long id) {
		// TODO Auto-generated method stub
		Criteria criteria=Criteria.create(BaseLanguage.class).where(" base_language_id", new Object[]{id});
		baseLanguageDao.delete(criteria);
	}

	/**
	 * 根据id 查询
	 */
	@Override
	public BaseLanguage findById(Long id) {
		// TODO Auto-generated method stub
		return baseLanguageDao.get(BaseLanguage.class, id);
	}

}
